HDR video and WCG video provide greater ranges of luminance and color values than traditional Standard Dynamic Range (SDR) video. For example, traditional video can have a limited luminance and color range, such that details in shadows or highlights can be lost when images are captured, encoded, and/or displayed. In contrast, HDR and/or WCG video can capture a broader range of luminance and color information, allowing the video to appear more natural and closer to real life to the human eye.
However, many common video encoding and decoding schemes, such as MPEG-4 Advanced Video Coding (AVC) and High Efficiency Video Coding (HEVC), are not designed to directly handle HDR or WCG video. As such, HDR and WCG video information is normally converted into other formats before it can be encoded using one of these video compression algorithms.
For example, HDR video formats such as the EXR file format describe colors in the Red, Green, Blue (RGB) color space with 16-bit half-precision floating point values having 10 significant bits, 5 exponent bits and one sign bit. These values cover a broad range of potential intensity and color values. SDR video employs 8 or 10-bit integer values to express the colors of non-HDR and non WCG video. Many existing video compression algorithms are meant for use with SDR video and, thus, expect to receive 8 or 10-bit integer values. It may be difficult to quantize the 16-bit half-precision floating point color values into 10-bit values that the compression algorithms can work with without substantially reducing video dynamic range or introducing significant distortion.
Some encoders use a coding transfer function to convert linear values from the input video into non-linear values prior to uniform quantization. By way of a non-limiting example, a coding transfer function may include a gamma function that compresses luminance and/or color (chrominance) values at one or both ends of the quantization range so that a larger range may be represented by the 8 or 10 bit values provided to the encoder. However, even when an encoder uses a coding transfer function to convert linear input values into non-linear values, the coding transfer function may be fixed, such that it does not change dependent on the content of the input video. For example, an encoder's coding transfer function can be defined to statically map every possible input value in an HDR range, such as from 0 to 10,000 nits (candelas per square meter or cd/m2), to specific non-linear values ranging from 0 to 255 for 8-bit values or 0 to 1023 for 10 bit values. When the input video contains input values in only a portion of that range, however, fixed mapping can lead to poor allocation of quantization levels resulting in quantization distortion in the reproduced image. For example, a picture primarily showing a blue sky can have many similar shades of blue, but those blue shades can occupy a small section of the overall range for which the coding transfer function is defined. As such, similar blue shades may be quantized into the same value. This quantization may be perceived by viewers as contouring or banding, where quantized shades of blue extend in bands across the sky displayed on their screen instead of a more natural transitions between the shades.
Additionally, psychophysical studies of the human visual system have shown that a viewer's sensitivity to contrast levels at a particular location can be more dependent on the average brightness of surrounding locations than the actual levels at the location itself. Many coding transfer functions, however, do not take this into account and instead use fixed conversion functions or tables that do not take characteristics of the surrounding pixels, into account.